<?php

namespace App\Modules\Doctor\Models;


use Illuminate\Database\Eloquent\Model;

/**
 * @package App\Modules\Doctor\Models
 */
class Doctor extends Model
{
    protected $table = 'doctor';

    protected $fillable = ['id','admin_user_id','name', 'gender', 'age', 'institution_id', 'department_id', 'contact','good_at','signature','certificate','created_at','updated_at','status'];

    /**
     * 地址列表
     */
    static function getList($param)
    {
        return self::where('status',1)->paginate($param['size']);
    }


    static function details($field,$id)
    {
        return self::where($field,$id)->first();
    }

    static function addDoctor($param)
    {
        // TODO check
        return self::create($param);
    }


    static function updateDoctor($param)
    {
        // TODO check
        return self::where('admin_user_id',$param['admin_user_id'])->update($param);
    }
}